// Thud - a dynamic object-oriented language
// Copyright (C) 2009,2010 David H. Hovemeyer <david.hovemeyer@gmail.com>

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

/*
 * Token2.cpp
 *
 *  Created on: Dec 11, 2009
 *      Author: dhovemey
 */

#include "fe/Token2.h"

Token2::Token2(int tokenType, const std::wstring &lexeme, const Location &loc, Token2 *prev)
	: m_tokenType(tokenType)
	, m_lexeme(lexeme)
	, m_loc(loc)
	, m_prev(prev)
	, m_next(0)
{
	if (prev != 0) {
		prev->m_next = this;
	}
}

Token2::~Token2()
{
}

int Token2::getTokenType() const
{
	return m_tokenType;
}

const std::wstring &Token2::getLexeme() const
{
	return m_lexeme;
}

const Location &Token2::getLocation() const
{
	return m_loc;
}
